package com.ticket.sass.provider.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ticket.sass.common.entity.tenant.FilmVersionEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author ywb
 * @since 2024-03-07
 */
@Mapper
public interface FilmVersionMapper extends BaseMapper<FilmVersionEntity> {
    @Update({
        "<script>",
        "<foreach collection='list' item='item' separator=';'>",
        "UPDATE film_versions SET name = #{item.name} WHERE code = #{item.code}",
        "</foreach>",
        "</script>"
    })
    void updateBatchByCode(@Param("list") List<FilmVersionEntity> list);
}
